home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / ioaxcc / inout.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-02-01  |  3.4 KB  |  119 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Parallel I/O ""Pins"""
  4.    ClientHeight    =   2385
  5.    ClientLeft      =   2775
  6.    ClientTop       =   1635
  7.    ClientWidth     =   6690
  8.    Height          =   2790
  9.    Left            =   2715
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2385
  12.    ScaleWidth      =   6690
  13.    Top             =   1290
  14.    Width           =   6810
  15.    Begin VB.TextBox Text2 
  16.       Height          =   285
  17.       Left            =   3600
  18.       TabIndex        =   5
  19.       Top             =   1680
  20.       Width           =   1935
  21.    End
  22.    Begin VB.CommandButton Command2 
  23.       Caption         =   "Win95/98 Only"
  24.       Height          =   495
  25.       Left            =   240
  26.       TabIndex        =   3
  27.       Top             =   1560
  28.       Width           =   1695
  29.    End
  30.    Begin VB.TextBox Text1 
  31.       Height          =   285
  32.       Left            =   3600
  33.       TabIndex        =   1
  34.       Top             =   960
  35.       Width           =   1935
  36.    End
  37.    Begin VB.CommandButton Command1 
  38.       Caption         =   "WinNT, Win95/98"
  39.       Height          =   495
  40.       Left            =   240
  41.       TabIndex        =   0
  42.       Top             =   840
  43.       Width           =   1695
  44.    End
  45.    Begin VB.Label Label4 
  46.       Caption         =   "Requires Loopback Connections"
  47.       Height          =   615
  48.       Left            =   5640
  49.       TabIndex        =   7
  50.       Top             =   840
  51.       Width           =   975
  52.    End
  53.    Begin VB.Label Label3 
  54.       Alignment       =   2  'Center
  55.       Caption         =   "This applet puts 0 to 255 on the parallel data pins (LPT1:) separated by a delay of 100 milliseconds."
  56.       Height          =   375
  57.       Left            =   240
  58.       TabIndex        =   6
  59.       Top             =   240
  60.       Width           =   5535
  61.    End
  62.    Begin VB.Label Label2 
  63.       Caption         =   "Parallel Port Data"
  64.       Height          =   255
  65.       Left            =   2160
  66.       TabIndex        =   4
  67.       Top             =   1680
  68.       Width           =   1335
  69.    End
  70.    Begin VB.Label Label1 
  71.       Caption         =   "Parallel Port Data"
  72.       Height          =   255
  73.       Left            =   2160
  74.       TabIndex        =   2
  75.       Top             =   960
  76.       Width           =   1335
  77.    End
  78.    Begin IOLib.IO IO1 
  79.       Left            =   5880
  80.       Top             =   0
  81.       _Version        =   65536
  82.       _ExtentX        =   1270
  83.       _ExtentY        =   1270
  84.       _StockProps     =   0
  85.    End
  86. Attribute VB_Name = "Form1"
  87. Attribute VB_Creatable = False
  88. Attribute VB_Exposed = False
  89. Private Sub Command1_Click()
  90. Dim Result As Integer
  91. Dim N As Integer
  92. Result = IO1.Open("LPT1:", "")
  93. If (Result = 0) Then
  94.   MsgBox ("Open failed")
  95. End If
  96. For N = 0 To 255
  97. Result = IO1.WriteByte(N)
  98. Text1.Text = N
  99. IO1.Sleep (100)
  100. DoEvents  'Allows text box to be updated
  101. If (Result = 0) Then
  102.   MsgBox ("WriteByte failed, make sure the parallel loopback connections are made." + Chr(13) + "See: 'schematics.html' or visit: 'http://members.aol.com/easyio/home.html'.")
  103.   IO1.Close
  104.   Exit Sub
  105. End If
  106. Next N
  107. IO1.Close
  108. End Sub
  109. Private Sub Command2_Click()
  110. Dim Result As Integer
  111. Dim N As Integer
  112. For N = 0 To 255
  113. Result = IO1.Out(&H378, N)
  114. Text2.Text = N
  115. IO1.Sleep (100)
  116. DoEvents  'Allows text box to be updated
  117. Next N
  118. End Sub
  119.